//
//  IntVclDrivedRecordInfo.m
//  Runone
//
//  Created by runone02 on 16/10/25.
//  Copyright © 2016年 runone. All rights reserved.
//

#import "IntVclDrivedRecordInfo.h"

#define  cellH     35
#define  margin    15
#define  disMargin 45
#define  DefaultH

@implementation IntVclDrivedRecordInfo
{
    CGFloat _vclPlanCellH;
    CGFloat _calDestinationH;
    CGFloat _calOriginH ;

}

+ (NSDictionary *)objectClassInArray{
    return @{
             @"IntVclUserInfoList" : [IntVclUserInfoModel class],
             };
}

- (CGFloat)vclPlanCellH   {
    if (!_vclPlanCellH) {
        CGSize maxSize        = CGSizeMake([UIScreen mainScreen].bounds.size.width - disMargin, MAXFLOAT);
        NSString *text1 = @"出发地:";
        NSString *str1 = [text1 stringByAppendingString:_Origin];
        CGFloat originH       = [str1 boundingRectWithSize:maxSize options:(NSStringDrawingUsesLineFragmentOrigin|NSStringDrawingUsesFontLeading) attributes:@{NSFontAttributeName : [UIFont systemFontOfSize:17]} context:nil].size.height;
        if (originH < cellH) {
            originH = cellH;
        }
        NSString *text2 = @"目的地";
        NSString *str2 = [text2 stringByAppendingString:_Destination];
        CGFloat destinationH  = [str2 boundingRectWithSize:maxSize options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName : [UIFont systemFontOfSize:15]} context:nil].size.height;
        if (destinationH < cellH) {
            destinationH = cellH;
        }
        _vclPlanCellH = cellH * 4 + originH + destinationH + margin;
    }
    return _vclPlanCellH ;
}

//- (CGFloat)calDestinationH {
//    
//    if (!_calDestinationH) {
//        CGSize maxSize        = CGSizeMake([UIScreen mainScreen].bounds.size.width - 25, MAXFLOAT);
//        CGFloat destinationH       = [_Destination boundingRectWithSize:maxSize options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName : [UIFont systemFontOfSize:15]} context:nil].size.height;
//        if (destinationH < cellH) {
//            _calDestinationH = cellH;
//        }else {
//            _calDestinationH = (destinationH / 17) * cellH;
//        }
//
//    }
//    return _calDestinationH;
//}
//
//- (CGFloat)calOriginH {
//    
//    if (!_calOriginH) {
//        CGSize maxSize        = CGSizeMake([UIScreen mainScreen].bounds.size.width - 25, MAXFLOAT);
//        CGFloat originH       = [_Origin boundingRectWithSize:maxSize options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName : [UIFont systemFontOfSize:15]} context:nil].size.height;
//        if (originH < cellH) {
//            _calOriginH = cellH;
//        }else {
//            _calOriginH = (originH / 17) * cellH;
//        }
//        
//    }
//    return _calOriginH;
//}





@end
